//
// Created by tu on 23-10-25.
//

#ifndef SUMORTISTATICLIB_ENTITY_H
#define SUMORTISTATICLIB_ENTITY_H

#include <string>
#include <list>
#include <iostream>
#include <RTI.hh>

using namespace std;
enum class SumoArgumentsEnum {
    help,
    noGui,
    filePath,
    stepLength,
    delay,
    sleep,
    ns3,
    offset,
};

struct SumoArguments {
    string noGui;
    string filePath;
    double stepLength;
    int delay;
    double sleep;
    int ns3;
    string offset;

    static void help() {
        list <string> help;
        help.emplace_back("SumoArguments参数用法");
        help.emplace_back("    --noGui\t\t\t是否使用sumo-gui，不加此参数则默认使用gui");
        help.emplace_back("    --filePath=<path>\t\tsumo的配置文件路径");
        help.emplace_back("    --stepLength=<step>\t\t仿真步长");
        help.emplace_back("    --delay=<delay>\t\t仿真延迟");
        help.emplace_back("    --sleep=<sleep>\t\t仿真休眠时间");
        help.emplace_back("    --ns3=<int>\t\t\t是否使用ns3");
        help.emplace_back("    --offset=<string>\t\t路网偏移量");
        for (const auto &i: help) {
            std::cout << i << std::endl;
        }
    }

    void Print() const {
        std::cout << "noGui:" << noGui << std::endl;
        std::cout << "filePath:" << filePath << std::endl;
        std::cout << "stepLength:" << stepLength << std::endl;
        std::cout << "delay:" << delay << std::endl;
        std::cout << "sleep:" << sleep << std::endl;
        std::cout << "ns3:" << ns3 << std::endl;
        std::cout << "offset:" << offset << std::endl;
    }

    friend ostream &operator<<(ostream &os, const SumoArguments &arguments) {
        os << "noGui: " << arguments.noGui << " filePath: " << arguments.filePath << " stepLength: "
           << arguments.stepLength << " delay: " << arguments.delay << " sleep: " << arguments.sleep << " ns3: "
           << arguments.ns3 << " offset: " << arguments.offset;
        return os;
    }
};

struct RTIambassadorReturn {
    int errorID = 0;
    RTI::RTIambassador rti;
};

struct FederateHandleReturn {
    int errorID = 0;
    RTI::FederateHandle federateId{};
};


#endif //SUMORTISTATICLIB_ENTITY_H
